﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IEntity.Entity;
using System.Data.Objects;

namespace DemoMenu_01.Models.Service
{
    public class EntitiyExtent : UnProEntities
    {


        public void addEntity<T>(List<T> lstInsert)
        {
            Type typeParameterType = typeof(T);
            EntitiyExtent entity = new EntitiyExtent();
            foreach (var item in lstInsert)
            {
                entity.AddObject(typeParameterType.Name, item);
            }
            entity.SaveChanges();
            ReleaseContext(entity);
        }
        public void ReleaseContext(EntitiyExtent Entity)
        {
            Entity = new EntitiyExtent();
        }

        


    }
}